package com.lemon.smartsafety.entity.address;

import com.lemon.smartsafety.entity.common.IndexModel;
import com.lemon.smartsafety.utils.common.StringUtils;

import java.io.Serializable;

/**
 * Created by Cooliean on 16/4/12.
 */
public class AddrBookInviteVo implements Serializable, IndexModel {
    private int book_id;
    private String book_name      = "";
    private String pinyin         = "";
    private String keywords       = "";
    private int    is_public      = 0;
    private String create_time    = "";
    private String create_user_id = "";
    private String remark         = "";

    private String user_name       = "";
    private int    book_user_id    = 0;
    private int    response_status = 0;
    private String response_time   = "";


    public int getBook_id() {
        return book_id;
    }

    public void setBook_id(int book_id) {
        this.book_id = book_id;
    }

    public String getBook_name() {
        return book_name;
    }

    public void setBook_name(String book_name) {
        this.book_name = book_name;
    }

    public String getPinyin() {
        return pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public int getIs_public() {
        return is_public;
    }

    public void setIs_public(int is_public) {
        this.is_public = is_public;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getCreate_user_id() {
        return create_user_id;
    }

    public void setCreate_user_id(String create_user_id) {
        this.create_user_id = create_user_id;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getUser_name() {
        return user_name;
    }

    public void setUser_name(String user_name) {
        this.user_name = user_name;
    }

    public int getBook_user_id() {
        return book_user_id;
    }

    public void setBook_user_id(int book_user_id) {
        this.book_user_id = book_user_id;
    }

    public int getResponse_status() {
        return response_status;
    }

    public void setResponse_status(int response_status) {
        this.response_status = response_status;
    }

    public String getResponse_time() {
        return response_time;
    }

    public void setResponse_time(String response_time) {
        this.response_time = response_time;
    }

    @Override
    public String getIndexCharI() {
        String charIndex = "";
        if (StringUtils.nullValue(getPinyin()).length() != 0) {
            charIndex = getPinyin().substring(0, 1);
        }
        return charIndex;
    }

    @Override
    public String getTitleI() {
        return this.book_name;
    }

    @Override
    public String getSubTitleI() {
        if(StringUtils.nullValue(getUser_name()).length()==0) return "";
        return String.format("%s邀请你加入", this.user_name);
    }

    @Override
    public String getStatusTip() {
        if (getResponse_status() == 0) {
            return "";
        } else if (getResponse_status() == 1) {
            return "已同意";
        }
        return "已拒绝";
    }

    @Override
    public int getStatusI() {
        return getResponse_status();
    }

    @Override
    public void setIndexChar(String indexChar) {
        this.pinyin = indexChar;
    }
}
